package com.atguigu.springcloud.rest;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author horay
 * @category Class description
 * @email horay_hyc@qq.com
 * @date 2018/6/18 0:13
 */
@RestController
public class ConfigController {

    @Value("${server.port}")
    private String serverPort;
    @Value("${spring.application.name}")
    private String applicationName;
    @Value("${eureka.client.server-url.defaultZone}")
    private String eurekaServerUrl;

    @GetMapping("/config")
    public String config() {
        return String.format("serverPort=%s, applicationName=%s, eurekaServerUrl=%s", serverPort, applicationName, eurekaServerUrl);
    }


}
